<?php

namespace app\admin\model;

use app\admin\traits\ScopeUniacid;
use app\common\model\TimeModel;

class KnscyRedpack extends TimeModel
{

    protected $name = "redpack";

    protected $deleteTime = "delete_time";

    protected $globalScope = ['uniacid'];
    use ScopeUniacid;

    public function getTypeLabelAttr($value, $data){
        $type = $this->getRedpackTypeList();
        return isset($type[$data['redpack_type']]) ? $type[$data['redpack_type']] : '';
    }

    public function getRedpackTypeList()
    {
        return ['1'=>'优惠券','2'=>'线下凭证',];
    }

    public function getStatusList()
    {
        return ['0'=>'禁用','1'=>'启用',];
    }


}